/*    */ package com.newcrm.webapi.sub;
/*    */ 
/*    */ import com.newcrm.bean.User;
/*    */ import com.newcrm.db.CustomerCategoryManager;
/*    */ import com.newcrm.exception.DBException;
/*    */ import com.newcrm.exception.NotFoundException;
/*    */ import com.newcrm.util.Util;
/*    */ import com.newcrm.webapi.AbstractAction;
/*    */ import com.newcrm.webapi.AbstractHttpServlet;
/*    */ import java.io.IOException;
/*    */ import java.sql.SQLException;
/*    */ import java.util.List;
/*    */ import javax.servlet.RequestDispatcher;
/*    */ import javax.servlet.ServletException;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import org.apache.log4j.Logger;
/*    */ 
/*    */ public class ListCustomerCategory extends AbstractAction
/*    */ {
/* 24 */   private static Logger logger = Logger.getLogger(ListCustomerCategory.class
/* 25 */     .getName());
/*    */ 
/*    */   public ListCustomerCategory(AbstractHttpServlet servlet)
/*    */   {
/* 28 */     super(servlet);
/*    */   }
/*    */ 
/*    */   public void parse(HttpServletRequest request, HttpServletResponse response)
/*    */     throws IOException, ServletException, NotFoundException
/*    */   {
/* 34 */     User user = super.getLoginUser(request);
/*    */ 
/* 36 */     int categoryType = Util.getURLIntParameter(request
/* 37 */       .getParameter("categoryType"));
/*    */ 
/* 40 */     if (categoryType <= 0) {
/* 41 */       categoryType = 1;
/*    */     }
/*    */ 
/* 44 */     CustomerCategoryManager manager = new CustomerCategoryManager();
/*    */     try {
/* 46 */       List result = manager.list(user.companyId, 
/* 47 */         categoryType);
/* 48 */       request.setAttribute("customercategory", result);
/* 49 */       request.getRequestDispatcher("/customerCategorys.jsp").forward(
/* 50 */         request, response);
/*    */     } catch (DBException e) {
/* 52 */       logger.warn("get category list failed", e);
/*    */     } catch (SQLException e) {
/* 54 */       logger.warn("get category list failed", e);
/*    */     }
/*    */   }
/*    */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.sub.ListCustomerCategory
 * JD-Core Version:    0.6.1
 */